﻿@using Wicresoft.UnifyShow.Business;
@{
    ViewBag.Title = "总览";
    Layout = "~/Views/Shared/_LayoutBasicEnvironment.cshtml";
    List<SiteAndSLASumModel> listSLAS = (List<SiteAndSLASumModel>)ViewData["SLAS"];
    List<SiteAndSLASumModel> listSLASite = new List<SiteAndSLASumModel>();
    List<SiteAndSLASumModel> listSLASiteTitle = new List<SiteAndSLASumModel>();
    List<string> listSLATitles = new List<string>();
    List<string> sitesSLA = listSLAS.OrderBy(o => o.ID).Select(o => o.Name).Distinct().ToList();
    List<SiteBranchModel> sites = (List<SiteBranchModel>)ViewData["Sites"];
}
<div class="main_right">
    <div class="right_title2">
        <a href="/Home/Index">首页</a> > 基础设施 > <span>总览</span></div>
    <!--**************************************************************************************************************************************************-->
    <div class="index_lr">
        <ul>
            <li class="index_lr2_M">
                <div class="index_lrA_title ui-icons">
                    <h3>
                        基础信息</h3>
                </div>
                <div>
                    @Html.Partial("~/Views/BasicInfoTablePartialView/BasicInfoTablePartialView.cshtml", new ViewDataDictionary() {
               {"alerts",ViewData["AlertCount"]},{"sitesMe",ViewData["SitesMe"]}      
               })
                </div>
            </li>
        </ul>
    </div>
    <div class="clear">
    </div>
    <!--**************************************************************************************************************************************************-->
    <div class="index_lr">
        <ul>
            <li class="index_lr3_L">
                <div class="index_lrA_title ui-icons">
                    <h3>
                        工单信息</h3>
                </div>
                <div class="index_pt_bg scroll">
                    <table width="100%" border="0" cellpadding="0" cellspacing="0">
                        <tbody>
                            <tr>
                                <td class="padding_A" width="30%">
                                    @Html.Partial("~/Views/WorkListPartialView/WorkListPartialViewByincident.cshtml", (List<Wicresoft.UnifyShow.Business.SiteBranchAndWorkListModel>)ViewData["Incidents"], new ViewDataDictionary() { { "SitesMe", ViewData["SitesMe"] } })
                                </td>
                                <td class="padding_A" width="30%">
                                    @Html.Partial("~/Views/WorkListPartialView/WorkListPartialViewBychange.cshtml", (List<Wicresoft.UnifyShow.Business.SiteBranchAndWorkListModel>)ViewData["Changes"], new ViewDataDictionary() { { "SitesMe", ViewData["SitesMe"] } })
                                </td>
                                <td class="padding_A" width="30%">
                                    @Html.Partial("~/Views/WorkListPartialView/WorkListPartialViewByproblem.cshtml", (List<Wicresoft.UnifyShow.Business.SiteBranchAndWorkListModel>)ViewData["Problems"], new ViewDataDictionary() { { "SitesMe", ViewData["SitesMe"] } })
                                </td>
                            </tr>
                        </tbody>
                    </table>
                </div>
            </li>
            <li class="index_lr3_R">
                <div class="index_lrA_title ui-icons">
                    <h3>
                        SLA</h3>
                </div>
                <div class="index_pt_bg scroll">
                    @foreach (var siteItem in sitesSLA)
                    {
                        listSLASite = listSLAS.Where(o => o.Name == siteItem).ToList();
                        listSLATitles = listSLASite.Select(o => o.Title).Distinct().OrderBy(o => o).ToList();
                        <p>@sites.FirstOrDefault(o => string.Equals(o.Name, siteItem)).Alias</p>
      
                        <table class="ContactTH talbe_gray" width="180" height="110" border="0" cellpadding="0"
                            cellspacing="0">
                            <thead>
                                <tr class="ContactTH">
                                    <th width="50%">
                                        目标
                                    </th>
                                    <th width="25%">
                                        类型
                                    </th>
                                    <th width="25%">
                                        数量
                                    </th>
                                </tr>
                            </thead>
                            <tbody>
                                @foreach (string item in listSLATitles)
                                {
                                    listSLASiteTitle = listSLASite.Where(o => o.Title == item).ToList();
                                    <tr>
                                        <td rowspan="3">
                                            @item
                                        </td>
                                        <td>
                                            达标
                                        </td>
                                        <td>
                                            @listSLASiteTitle.Select(o => StatusHelper.SLAStatus(o.Status)).Where(o => o.Equals("达标")).Count()
                                        </td>
                                    </tr>
                                    <tr>
                                        <td>
                                            未达标
                                        </td>
                                        <td>
                                            @listSLASiteTitle.Select(o => StatusHelper.SLAStatus(o.Status)).Where(o => o.Equals("未达标")).Count()
                                        </td>
                                    </tr>
                                    <tr>
                                        <td>
                                            告警
                                        </td>
                                        <td>
                                            @listSLASiteTitle.Select(o => StatusHelper.SLAStatus(o.Status)).Where(o => o.Equals("告警")).Count()
                                        </td>
                                    </tr>
                                }
                            </tbody>
                        </table>
                    }
                </div>
            </li>
        </ul>
    </div>
    <div class="clear">
    </div>
</div>
@section  LeftMenu {
    <li class="VNavLeaf ui-icons">总览</li>
    <li><a href="@Url.Action("Index", "BasicEnvironmentDetail")">详细情况</a></li>
}
